#include <stdio.h>
int main()
{
    printf("please enter n:");
    int n;
    scanf("%d", &n);
    float sum = 0;
    int  i = 1, sign = 1;
    while (i <= n)
    {

        sum = sum + sign * 1.0f / i;
        i++;
        sign = -sign;
    }
    printf("sum=%f\n", sum);
    printf("over!");

    return 0;
}